package com.neutech.neudoc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.neutech.neudoc.service.DocService;
import com.neutech.po.Doctor;

@RestController
@RequestMapping("/his/doc")
public class DocController {
	@Autowired
	private DocService docService;
	@RequestMapping(value="/selectNopatient")
	public void selectNopatient(Integer keywords02){
		System.out.println(keywords02);
		
	}
	@RequestMapping(value="/insert",method=RequestMethod.POST)
	public String insertDoc(Doctor doctor){
		docService.insertDoc(doctor);
		return "增加成功";
	}
	@RequestMapping(value="/update",method=RequestMethod.POST)
	public String updateDoc(Doctor doctor){
		int a = docService.updateDoc(doctor);
		if(a>=1){
			return "修改成功";
		}
		return "修改失败";
	}
	@RequestMapping(value="/delect",method=RequestMethod.POST)
	public @ResponseBody String delectDocById(int id){
		int a = docService.delectDocById(id);
		if(a>=1){
			return "删除成功";
		}
		return "删除失败";
	}

}
